package com.test.entity;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.MapKey;
import javax.persistence.MapKeyColumn;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import com.question.entity.Options;

@Entity
@Table(name="t_test")
public class test implements Serializable{
	private Long id;
	private String content;
	private Map<Integer, Options> map = new HashMap<Integer, Options>();
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	public Long getId() {
		return id;
	}
	@OneToMany
	@JoinTable(name="t_test_options",inverseJoinColumns=@JoinColumn(name="propValue"))
	@MapKeyColumn(name="propKey")
	public Map<Integer, Options> getMap() {
		return map;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public void setMap(Map<Integer, Options> map) {
		this.map = map;
	}
	@Column(length=6000)
	public String getContent() {
		return content;
	}
	public void setContent(String content) {
		this.content = content;
	}
	
}
